const axIos = require('axios');
class Request {
    /**
     * 发送get请求
     * @param url
     * @returns {Promise<axIosResponse<T>>}
     */
    async get(url) {
        let data = await axIos.get(url).then(res => res.data);
        return data;
    }

    /**
     * 发送post请求
     * @param data
     * @param url
     * @returns {Promise<void>}
     */
    async post(data, url) {
        let row = await axIos.post(url, data).then(res => res.data);
        return row;
    }
}

module.exports = new Request();
